﻿// ***********************************************************************
// Assembly         : ZFGK.osgEarth.PlatformGUI
// Author           : tianteng
// Created          : 05-04-2017
//
// Last Modified By : tianteng
// Last Modified On : 06-18-2019
// ***********************************************************************
// <copyright file="Zf3DConfigUtil.cs" company="北京智帆高科科技有限公司">
//     Copyright © 北京智帆高科科技有限公司 2016
// </copyright>
// <summary></summary>
// ***********************************************************************
using System.IO;
using System.Reflection;
using ZFGK.IO;
using ZFGK.Sys;
using ZFGK.Utility;

namespace OSS.Earth.Utility
{
    /// <summary>
    /// Class Zf3DConfigUtil.
    /// </summary>
    public static class Zf3DConfigUtil
    {
        /// <summary>
        /// 配置目录
        /// </summary>
        /// <value>The application data path.</value>
        public static string AppDataPath { get { return Path.Combine(EnvironmentUtil.ApplicationDataPath(), "Zf3D"); } }

        /// <summary>
        /// APP目录
        /// </summary>
        /// <value>The application path.</value>
        public static string AppPath { get { return Assembly.GetExecutingAssembly().FolderPath(); } }

        /// <summary>
        /// 缓存目录.
        /// </summary>
        /// <value>The cache path.</value>
        public static string CachePath { get { return Path.Combine(AppDataPath, "Cache"); } }

        /// <summary>
        /// 获得项目配置文件
        /// </summary>
        /// <value>The configuration file path.</value>
        public static string ConfigFilePath { get { return Path.Combine(AppDataPath, "Config.ini"); } }

        /// <summary>
        /// 临时模型目录.
        /// </summary>
        /// <value>The temporary model path.</value>
        public static string TempModelPath { get { return Path.Combine(AppDataPath, "TempModelFile"); } }

        /// <summary>
        /// 用户模型目录.
        /// </summary>
        /// <value>The user model path.</value>
        public static string UserModelPath { get { return Path.Combine(AppDataPath, "UserModelFile"); } }


        /// <summary>
        /// 获得项目配置文件.
        /// </summary>
        /// <returns>IniFile.</returns>
        public static IniFile ConfigFile { get { return new IniFile(ConfigFilePath); } }

        /// <summary>
        /// Gets the configuration file.
        /// </summary>
        /// <param name="curField">The current field.</param>
        /// <returns>IniFile.</returns>
        public static IniFile GetConfigFile(string curField)
        {
            return new IniFile(ConfigFilePath, curField);
        }


        /// <summary>
        /// 数据库文件.
        /// </summary>
        /// <returns>System.String.</returns>
        public static string DatabasePath { get { return Path.Combine(AppDataPath, "database.db"); } }

        /// <summary>
        /// 基础的数据库文件.
        /// </summary>
        /// <returns>System.String.</returns>
        public static string BaseDatabasePath { get { return Path.Combine(AppPath, "database", "database.db"); } }
    }
}
